
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<link rel=stylesheet href='include/hoj.css' type='text/css'>
</head>
<body>
<center>
<div style="width:90%; text-align:left">
<img src="image/logo.png"/>
</div>
<table width=96%> 
	<tr align="center" class='hd' valign="top">
				<th><a href="faqs.php">F.A.Qs</a></th>
		<th><a href="./bbs.php">Web Board</a></th>
		<th><a href="./">Home</a></th>
		<th><a href="./problemset.html">ProblemSet</a></th>
		<th><a href="./status.php">Status</a></th>
		<th><a href="./ranklist.php">Ranklist</a></th>
		<th><a href="./contest.php">Contest</a></th>
		<th><a href=loginpage.php>Login</a></th><th><a href=registerpage.php>Register</a></th>	</tr>
</table>
</center>
<center>
<div class="notice">
	<div>
		<B>Notice:</B>鉴于种种原因，本OJ自下周星期一（3月5号）开始不再全面开放，请各位做好善后事宜，谢谢合作。	</div>
</div>
</center>
</div>
<title>Problem 1744. -- [Usaco2005 oct]Skiing -- 衡阳八中OJ离线版-2012-02-29</title><center><h2>1744: [Usaco2005 oct]Skiing</h2><span class=green>Time Limit: </span>5 Sec&nbsp;&nbsp;<span class=green>Memory Limit: </span>64 MB<br><span class=green>Submit: </span>106&nbsp;&nbsp;<span class=green>Solved: </span>16<br>[<a href='submitpage.php?id=1744'>Submit</a>][<a href='problemstatus.php?id=1744'>Status</a>][<a href='bbs.php?id=1744'>Discuss</a>]</center><h2>Description</h2><div class=content>Bessie and the rest of Farmer John's cows are taking a trip this
winter to go skiing.  One day Bessie finds herself at the top left
corner of an R (1 <= R <= 100) by C (1 <= C <= 100) grid of elevations
E (-25 <= E <= 25). In order to join FJ and the other cows at a
discow party, she must get down to the bottom right corner as quickly
as she can by travelling only north, south, east, and west.

Bessie starts out travelling at a initial speed V (1 <= V <=
1,000,000).  She has discovered a remarkable relationship between
her speed and her elevation change.  When Bessie moves from a
location of height A to an adjacent location of height B, her speed
is multiplied by the number 2^(A-B).  The time it takes Bessie to
travel from a location to an adjacent location is the reciprocal
of her speed when she is at the first location.

Find the both smallest amount of time it will take Bessie to join
her cow friends and the number of moves required by the path (a
move is a transition from one location to another adjacent location).

</div><h2>Input</h2><div class=content>* Line 1: Three space-separated integers: V, R, and C, which
        respectively represent Bessie's initial velocity and the
        number of rows and columns in the grid.

* Lines 2..R+1: C integers representing the elevation E of the
        corresponding location on the grid.

</div><h2>Output</h2><div class=content>A single number value, printed to two exactly decimal places: the
minimum amount of time that Bessie can take to reach the bottom right
corner of the grid.

</div><h2>Sample Input</h2>
			<div class=content><span class=sampledata>1 3 3  //奶牛开始在左上角，速度为1,它可以移动到别的格子上，速度会发生变化<br />
1 5 3 //这个3*3的数矩阵代表每个格子的参数，当从一个格子A到B时，速度变成V*2^(A-B)<br />
6 3 5<br />
2 4 3<br />
</span></div><h2>Sample Output</h2>
			<div class=content><span class=sampledata>29.00<br />
<br />
OUTPUT DETAILS:<br />
<br />
Bessie's best route is:<br />
	Start at 1,1 time  0 speed 1<br />
	East  to 1,2 time  1 speed 1/16<br />
	South to 2,2 time 17 speed 1/4<br />
	South to 3,2 time 21 speed 1/8<br />
	East  to 3,3 time 29 speed 1/4<br />
</span></div><h2>HINT</h2>
			<div class=content><p></p></div><h2>Source</h2>
			<div class=content><p><a href='problemset.html?search=Gold'>Gold</a></p></div><center>[<a href='submitpage.php?id=1744'>Submit</a>][<a href='problemstatus.php?id=1744'>Status</a>][<a href='bbs.php?id=1744'>Discuss</a>]</center>﻿<br>

<a href="./"><span class=red>HOME</span></a>
<a href="javascript:history.go(-1)"><span class=red>Back</span></a>

<hr>
<center>
	<div class="footer">
			<a href=setlang.php?lang=ko>한국어</a>&nbsp;
		<a href=setlang.php?lang=cn>中文</a>&nbsp;
		<a href=setlang.php?lang=fa>فارسی</a>&nbsp;
		<a href=setlang.php?lang=en>English</a>&nbsp;
		<a href=setlang.php?lang=th>ไทย</a>
	<br>		<div>版权所有 &copy;2008-2012 WaterPark Organization. | <script src="http://s21.cnzz.com/stat.php?id=2982771&web_id=2982771" language="JavaScript"></script>
</div>
		<div>Based on opensource project <a href="http://hustoj.googlecode.com">hustoj</a>.</div>
	</div>
</center>
</body>
</html>
